import {getGoodsList} from '@/ajax'
const state = {
  goodsList: {}
}
const mutations = {
  GETGOODSLIST(state,data) {
    state.goodsList = data
  }
}
const actions = {
  async getGoodsList({commit},searchParams) {
    const {data} = await getGoodsList(searchParams)
    commit('GETGOODSLIST',data)
  }
}
const getters = {
  attrsList(state) {
    return state.goodsList.attrsList || []
  },
  goodsList(state) {
    return state.goodsList.goodsList || []
  },
  trademarkList(state) {
    return state.goodsList.trademarkList || []
  },
  Total() {
    return state.goodsList.total || 0
  }
}
export default {
  state,
  mutations,
  actions,
  getters
}